﻿#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include <string.h>

void reverse(char* str,int sz)
{
	char* left = str;
	char* right = str + sz - 1;
	//当左指针在右指针左边时，进⾏交换
	while (left < right)
	{
		char tmp = *left;
		*left = *right;
		*right = tmp;
		left++;
		right--;
	}
}

int main()
{
	char arr[31] = { 0 };
	//输⼊字符串
	scanf("%[^\n]s", arr);
	//计算长度
	int sz = strlen(arr);
	//逆序字符串
	reverse(arr,sz);
	//输出
	printf("%s\n", arr);
	return 0;
}
